<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org">
<head th:include="inc/home::header">
</head>
<link type="text/css" th:href="@{/css/login.css}" rel="stylesheet" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<meta name="context-path" th:content="@{/}" />
<body>



	<!--内容区-->
	<div class="login-content">
		<div class="login-a">
			<div class="login-aa">请联系厂商，输入激活码！</div>
			<form id="activateForm">
				<div class="login-ab">
					机器的物理地址：
					<div th:each="mapS:${macMap}">
						<div th:text="${mapS.value}"></div>
					</div>


					<ul>
						<li>
							<div class="login-password"></div> <input type="text"
							name="activateNum" class="input-text" placeholder="请输入激活码" />
						</li>
						<li><input type="button" id="activate" value="激 活"
							class="submit-text" /></li>
					</ul>
				</div>
			</form>
		</div>
	</div>

</body>
<script th:inline="javascript">
	/*<![CDATA[*/
	      var zhpath = [[${zhpath}]];        
	           
	           
	$(function() {
		$('#activate').on('click', function(e) {
			var data = getDataJson("activateForm");
			var obj = JSON.stringify(data);
			AjaxWebTableInfo("/admin/activate", data);

		});

	});

	function AjaxWebTableInfo(url, obj) {
var pd="1"
	$.ajax({
					type : "post",
					dataType : "json",
					async:false, 
					url : url,
					data : obj,
					success : function(data, status) {
						pd=data;
						if (data == "1") {
							$
									.Zebra_Dialog(
											'<div class="prompt"><div class="success-icon"></div><div class="success-title">激活成功!</div></div>',
											{
												'title' : '提示',
												'show_close_button' : false,
												'buttons' : [ {
													caption : '确定',
													callback : function() {
														window.location.href = "/"
													}
												} ]
											});

						} else if (data == "2") {
							$.Zebra_Dialog(
											'<div class="prompt"><div class="success-icon"></div><div class="success-title">激活码不对,软件自毁中!</div></div>',
											{
												'title' : '提示',
												'show_close_button' : false,
												'buttons':  false,
												'overlay_close':false,
												'auto_close':10000,
												'onClose':  function(caption) {
									/* 				   var  obj={path:"G:\\\\kinggsoft\\\\kduu_ba\\\\sp7\\\\knetscan.exe"}
													   $.post("Tool/runTimeCmd",obj); */
													   
													   
												    }
											});
						} else {
							$.Zebra_Dialog(
											'<div class="prompt"><div class="success-icon"></div><div class="success-title">请联系系统研发商!</div></div>',
											{
												'title' : '提示',
												'show_close_button' : false,
												'buttons' : [ {
													caption : '确定',
													callback : function() {
														window.location.href = "/"
													}
												} ]
											});
						}

					},
					error : function(data) {

					}
				});
	
	
	
	
	alert(pd)
	
	
	
	
	
	
	
	}
	/*]]>*/
</script>
</html>

